package pl.edu.agh.mgr.hotel;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Hotel {

    @NotNull
    @Size(max = 100)
    private String name;

    @NotNull
    @ManyToOne
    private Country country;

    @NotNull
    @ManyToOne
    private Province province;

    @NotNull
    @ManyToOne
    private City city;

    @NotNull
    @ManyToOne
    private Street street;

    @NotNull
    @Size(max = 20)
    private String address;
    
    @NotNull
    @ManyToOne
    private HotelType hotelType;
    
    @NotNull
    @OneToMany(cascade = CascadeType.ALL)
    private Set<Room> rooms = new HashSet<Room>();
}
